﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using AtletIS.Shared.Entities;

namespace AtletIS.Shared
{
    public static class Globals
    {
        static Globals()
        {
            Globals.FalseStartPort = 3;
        }
        
        public const int SprintCode = 1;
        public const int LongRunCode = 2;
        public const int ThrowsCode = 3;
        public const int HorJumpCode = 4;
        public const int VerJumpCode = 5;
        public const int MarathonCode = 6;
        public const int PointsDesc = 7;
        public const int PointsAsc = 8;
        public const int Triathlon = 9;

        public const int StatusInProgress = 2;
        public const int StatusFinished = 3;
        
        private static CompetitionEntity _activeCompetition;
        private static DisciplineListEntity _activeDiscipline;

        public static CompetitionEntity ActiveCompetition
        {
            get
            {
                if (_activeCompetition == null)
                    _activeCompetition = new CompetitionEntity();
                return _activeCompetition;
            }
            set
            {
                _activeCompetition = value;
            }
        }

        public static DisciplineListEntity ActiveDiscipline
        {
            get
            {
                if (_activeDiscipline == null)
                    _activeDiscipline = new DisciplineListEntity();
                return _activeDiscipline;
            }
            set
            {
                _activeDiscipline = value;
            }
        }

        #region IO

        public static int? FalseStartPort { get; set; }

        #endregion

    }
}
